Debian 9 Stretch
Sponsored Link

OpenStack Newton : Configure Networking
2017/07/02
 
Configure Networking for Virtual Machine Instances.
Configure basic settings first for Neutron Services like All in One Settings or Neutron Nodes like here.
For example, configure FLAT type of provider networking on here. The Node has 2 network interfaces like follows.
                  eth0|10.0.0.30 
          +-----------+-----------+
          |    [ Control Node ]   |
          |                       |
          |  MariaDB    RabbitMQ  |
          |  Memcached  httpd     |eth1
          |  Keystone   Glance    +------
          |   Nova API,Compute    |
          |    Neutron Server     |
          |  L2,L3,Metadata Agent |
          +-----------------------+

[1] Configure Neutron services.
root@dlp ~(keystone)#
ovs-vsctl add-br br-eth1

# add eth1 to a bridge port

root@dlp ~(keystone)#
ovs-vsctl add-port br-eth1 eth1

root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/ml2_conf.ini
# line 129: change

flat_networks =
physnet1
root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/openvswitch_agent.ini
# line 156: comment out

#
tunnel_id_ranges = 1:1000
# line 180: uncomment and change

bridge_mappings =
physnet1:br-eth1
root@dlp ~(keystone)#
systemctl restart neutron-openvswitch-agent

[2] Create virtual network.
root@dlp ~(keystone)#
projectID=`openstack project list | grep service | awk '{print $2}'`
# create network named [sharednet1]

root@dlp ~(keystone)#
openstack network create --project $projectID \
--share --provider-network-type flat --provider-physical-network physnet1 sharednet1

+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        |                                      |
| created_at                | 2017-07-06T06:04:07Z                 |
| description               |                                      |
| headers                   |                                      |
| id                        | 2ce50f5b-424a-4508-8928-939844fcceac |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| mtu                       | 1500                                 |
| name                      | sharednet1                           |
| port_security_enabled     | True                                 |
| project_id                | beaff0668ead4d48a63a80d1208dd9e1     |
| project_id                | beaff0668ead4d48a63a80d1208dd9e1     |
| provider:network_type     | flat                                 |
| provider:physical_network | physnet1                             |
| provider:segmentation_id  | None                                 |
| revision_number           | 3                                    |
| router:external           | Internal                             |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tags                      | []                                   |
| updated_at                | 2017-07-06T06:04:07Z                 |
+---------------------------+--------------------------------------+

# create subnet [10.0.0.0/24] in [sharednet1]

root@dlp ~(keystone)#
openstack subnet create subnet1 --network sharednet1 \
--project $projectID --subnet-range 10.0.0.0/24 \
--allocation-pool start=10.0.0.200,end=10.0.0.254 \
--gateway 10.0.0.1 --dns-nameserver 10.0.0.10

+-------------------+--------------------------------------+
| allocation_pools  | 10.0.0.200-10.0.0.254                |
| cidr              | 10.0.0.0/24                          |
| created_at        | 2017-07-06T06:05:53Z                 |
| description       |                                      |
| dns_nameservers   | 10.0.0.10                            |
| enable_dhcp       | True                                 |
| gateway_ip        | 10.0.0.1                             |
| headers           |                                      |
| host_routes       |                                      |
| id                | 4aa742a7-8caf-4435-906b-47622e9f3cb2 |
| ip_version        | 4                                    |
| ipv6_address_mode | None                                 |
| ipv6_ra_mode      | None                                 |
| name              | subnet1                              |
| network_id        | 2ce50f5b-424a-4508-8928-939844fcceac |
| project_id        | beaff0668ead4d48a63a80d1208dd9e1     |
| project_id        | beaff0668ead4d48a63a80d1208dd9e1     |
| revision_number   | 2                                    |
| service_types     | []                                   |
| subnetpool_id     | None                                 |
| updated_at        | 2017-07-06T06:05:53Z                 |
+-------------------+--------------------------------------+

# confirm settings

root@dlp ~(keystone)#
openstack network list

+--------------------------------------+------------+--------------------------------------+
| ID                                   | Name       | Subnets                              |
+--------------------------------------+------------+--------------------------------------+
| 2ce50f5b-424a-4508-8928-939844fcceac | sharednet1 | 4aa742a7-8caf-4435-906b-47622e9f3cb2 |
+--------------------------------------+------------+--------------------------------------+

root@dlp ~(keystone)#
openstack subnet list

+--------------------------------------+---------+--------------------------------------+-------------+
| ID                                   | Name    | Network                              | Subnet      |
+--------------------------------------+---------+--------------------------------------+-------------+
| 4aa742a7-8caf-4435-906b-47622e9f3cb2 | subnet1 | 2ce50f5b-424a-4508-8928-939844fcceac | 10.0.0.0/24 |
+--------------------------------------+---------+--------------------------------------+-------------+
 
Tweet